home *** CD-ROM | disk | FTP | other *** search
/ SuperHack / SuperHack CD.bin / CODING / GRAPHICS / VOXRAY.ZIP / DOOMDATA.H < prev    next >
Encoding:
C/C++ Source or Header  |  1995-08-02  |  5.3 KB  |  205 lines

  1. /* DoomData.h */
  2.  
  3. /*
  4.  all external data is defined here
  5.  most of the data is loaded into different structures at run time
  6. */
  7.  
  8. #ifndef __DOOMDATA__
  9. #define __DOOMDATA__
  10.  
  11. #ifndef __BYTEBOOL__
  12. #define __BYTEBOOL__
  13. typedef enum {false, true} boolean;
  14. typedef unsigned char byte;
  15. #endif
  16.  
  17. #include "storage.h"
  18. /*
  19. ===============================================================================
  20.  
  21.                         map level types
  22.  
  23. ===============================================================================
  24. */
  25.  
  26. /* lump order in a map wad */
  27. enum {ML_LABEL, ML_THINGS, ML_LINEDEFS, ML_SIDEDEFS, ML_VERTEXES, ML_SEGS,
  28. ML_SSECTORS, ML_NODES, ML_SECTORS , ML_REJECT, ML_BLOCKMAP};
  29.  
  30.  
  31. typedef struct
  32. {
  33.     short           x,y;
  34. } mapvertex_t;
  35.  
  36. typedef struct
  37. {
  38.     short           textureoffset;
  39.     short           rowoffset;
  40.     char            toptexture[8], bottomtexture[8], midtexture[8];
  41.     short           sector;                         /* on viewers side */
  42. } mapsidedef_t;
  43.  
  44. typedef struct
  45. {
  46.     short           v1, v2;
  47.     short           flags;
  48.     short           special, tag;
  49.     short           sidenum[2];                     /* sidenum[1] will be -1 if one sided */
  50. } maplinedef_t;
  51.  
  52. #define ML_BLOCKING                     1
  53. #define ML_BLOCKMONSTERS        2
  54. #define ML_TWOSIDED                     4               /* backside will not be present at all */
  55.                                                         /* if not two sided */
  56.  
  57. /*
  58.  if a texture is pegged, the texture will have the end exposed to air held
  59.  constant at the top or bottom of the texture (stairs or pulled down things)
  60.  and will move with a height change of one of the neighbor sectors
  61.  Unpegged textures allways have the first row of the texture at the top
  62.  pixel of the line for both top and bottom textures (windows)
  63. */
  64.  
  65. #define ML_DONTPEGTOP           8
  66. #define ML_DONTPEGBOTTOM        16
  67.  
  68. #define ML_SECRET                               32              /* dont map as two sided: ITS A SECRET! */
  69. #define ML_SOUNDBLOCK           64              /* dont let sound cross two of these            */
  70. #define ML_DONTDRAW                     128             /* dont draw on the automap                                                     */
  71. #define ML_MAPPED                               256             /* set if allready drawn in automap                     */
  72.  
  73.  
  74. typedef struct
  75. {
  76.     short           floorheight, ceilingheight;
  77.     char            floorpic[8], ceilingpic[8];
  78.     short           lightlevel;
  79.     short           special, tag;
  80. } mapsector_t;
  81.  
  82. typedef struct
  83. {
  84.     short           numsegs;
  85.     short           firstseg;                       /* segs are stored sequentially */
  86.     STORAGE *       cutbox;
  87. } mapsubsector_t;
  88.  
  89. typedef struct
  90. {
  91.     short           v1, v2;
  92.     short           angle;
  93.     short           linedef, side;
  94.     short           offset;
  95. } mapseg_t;
  96.  
  97. enum {BOXTOP,BOXBOTTOM,BOXLEFT,BOXRIGHT};       /* bbox coordinates */
  98.  
  99. #define NF_SUBSECTOR    0x8000
  100. typedef struct
  101. {
  102.     short           x,y,dx,dy;                      /* partition line */
  103.     short           bbox[2][4];                     /* bounding box for each child */
  104.     unsigned short  children[2];            /* if NF_SUBSECTOR its a subsector */
  105. } mapnode_t;
  106.  
  107. typedef struct
  108. {
  109.     short           x,y;
  110.     short           angle;
  111.     short           type;
  112.     short           options;
  113. } mapthing_t;
  114.  
  115. #define MTF_EASY                1
  116. #define MTF_NORMAL              2
  117. #define MTF_HARD                4
  118. #define MTF_AMBUSH              8
  119.  
  120. /*
  121. ===============================================================================
  122.  
  123.                         texture definition
  124.  
  125. ===============================================================================
  126. */
  127.  
  128. typedef struct
  129. {
  130.     short   originx;
  131.     short   originy;
  132.     short   patch;
  133.     short   stepdir;
  134.     short   colormap;
  135. } mappatch_t;
  136.  
  137. typedef struct
  138. {
  139.     char            name[8];
  140.     boolean         masked;
  141.     short           width;
  142.     short           height;
  143.     void            **columndirectory;      /* OBSOLETE */
  144.     short           patchcount;
  145.     mappatch_t      patches[1];
  146. } maptexture_t;
  147.  
  148.  
  149. /*
  150. ===============================================================================
  151.  
  152.                             graphics
  153.  
  154. ===============================================================================
  155. */
  156.  
  157. /*      posts are runs of non masked source pixels */
  158. typedef struct
  159. {
  160.     byte            topdelta;               /* -1 is the last post in a column */
  161.     byte            length;
  162. /* length data bytes follows */
  163. } post_t;
  164.  
  165. /* column_t is a list of 0 or more post_t, (byte)-1 terminated */
  166. typedef post_t  column_t;
  167.  
  168. /* a patch holds one or more columns */
  169. /* patches are used for sprites and all masked pictures */
  170. typedef struct
  171. {
  172.     short           width;          /*      bounding box size */
  173.     short           height;
  174.     short           leftoffset; /*pixels to the left of origin */
  175.     short           topoffset;  /* pixels below the origin */
  176.     int                     columnofs[8]; /* only [width] used;  the [0] is &columnofs[width] */
  177. } patch_t;
  178.  
  179. /*
  180.  a pic is an unmasked block of pixels
  181. */
  182.  
  183. typedef struct
  184. {
  185.     byte            width,height;
  186.     byte            data;
  187. } pic_t;
  188.  
  189.  
  190.  
  191.  
  192. /*
  193. ===============================================================================
  194.  
  195.                             status
  196.  
  197. ===============================================================================
  198. */
  199.  
  200.  
  201.  
  202.  
  203. #endif                  /* __DOOMDATA__ */
  204.  
  205.